package cn.shiwei.pet.domain;

import cn.shiwei.basic.domain.BaseDomain;
import cn.shiwei.org.domain.Shop;
import cn.shiwei.user.domain.User;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

@Data
public class Pet extends BaseDomain {
    /**
     * 上架时间
     */
    public static final String ADDED_TIME = "onsaletime";
    /**
     * 下架时间
     */
    public static final String OFF_SHELF_TIME = "offsaletime";

    /**
     * 在售状态
     */
    public static final Integer ON_SALE_STATUS = 1;
    /**
     * 未售状态
     */
    public static final Integer UN_SOLD_STATUS = 0;

    private String name;
    private String resources;
    private BigDecimal saleprice;
    private Date offsaletime;
    private Date onsaletime;
    private Integer state;
    private BigDecimal costprice;
    private Date createtime;
    private Long type_id;
    private PetType type;
    private Long shop_id;
    private Shop shop;
    private Long user_id;
    private User user;
    private Long search_master_msg_id = 0L;
    /**
     * 库存数量, 宠物默认1
     */
    private Long repertory = 1L;

    private PetDetail detail = new PetDetail();


    public String toJSONString() {

        return "{" +
                "\"name\":" + name +
                ", \"resources\":" + resources +
                ", \"saleprice\":" + saleprice +
                '}';
    }
}
